bitkeeper revision 1.563 (3fa90024LzzVnnkZsqlSu4CqEMBe_Q)
authorsmh22@labyrinth.cl.cam.ac.uk <smh22@labyrinth.cl.cam.ac.uk>
Wed, 5 Nov 2003 13:50:28 +0000 (13:50 +0000)
committersmh22@labyrinth.cl.cam.ac.uk <smh22@labyrinth.cl.cam.ac.uk>
Wed, 5 Nov 2003 13:50:28 +0000 (13:50 +0000)
fix for scsi

xen/drivers/block/xen_block.c

index 97f51e02f1bd38756ac8b2fd07151dd08f9f2378..4e0f422ae392763bb9565c591519d811362cff79 100644 (file)
@@ -536,15 +536,20 @@ static void dispatch_rw_block_io(struct task_struct *p, int index)
        rc = vbd_translate(&phys_seg[nr_psegs], &new_segs, p, operation); 
 
        /* If it fails we bail (unless the caller is priv => has raw access) */
-       if(rc && !IS_PRIV(p)) { 
-           printk("access denied: attempted %s of [%ld,%ld] on dev=%04x\n", 
-                  operation == READ ? "read" : "write", 
-                  req->sector_number + tot_sects, 
-                  req->sector_number + tot_sects + nr_sects, 
-                  req->device); 
-           goto bad_descriptor;
+       if(rc) { 
+           if(!IS_PRIV(p)) {
+               printk("access denied: %s of [%ld,%ld] on dev=%04x\n", 
+                      operation == READ ? "read" : "write", 
+                      req->sector_number + tot_sects, 
+                      req->sector_number + tot_sects + nr_sects, 
+                      req->device); 
+               goto bad_descriptor;
+           }
+
+           /* SMH: skanky hack; clear any 'partition' info in device */
+           phys_seg[nr_psegs].dev = req->device & 0xFFF0;
        }
-           
+        
         nr_psegs += new_segs;
         if ( nr_psegs >= (MAX_BLK_SEGS*2) ) BUG();
     }